Conversation
Contributor
Summary: Reimplement the small pieces of `cosmiconfig` we need to make config loading work as it always has, while dropping a fairly [complex](https://npmgraph.js.org/?q=cosmiconfig%405.2.1) and out-of-date dependency. This is intended to be fully behaviour-preserving. ## YAML support Metro has always had YAML config support in a fashion, but only if the config file is explicitly specified (eg via `--config=foo.yaml`). Because it's likely very little used, it has no ability to express JS functions, sets or maps, and has no type checking, and requires a dependency on a YAML parser, this change marks it deprecated with a console warning (since at this stage, we have no reporter). Once we remove YAML support, loading config becomes extremely simple. Changelog: Internal Test Plan: - New/rewritten tests - Reviewed By: huntie Differential Revision: D80083881 Pulled By: robhogan
339629a to
8f1281b
Compare
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D80083881 |
Contributor
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reimplement the small pieces of cosmiconfig we need to make config loading work as it always has, while dropping a fairly complex and out-of-date dependency.
This is intended to be fully behaviour-preserving.
YAML support
Metro has always had YAML config support in a fashion, but only if the config file is explicitly specified (eg via --config=foo.yaml).
Because it's likely very little used, it has no ability to express JS functions, sets or maps, and has no type checking, and requires a dependency on a YAML parser, this change marks it deprecated with a console warning (since at this stage, we have no reporter). Once we remove YAML support, loading config becomes extremely simple.
Changelog: